<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>编译原理笔记 | whoway</title>
    <meta name="description" content="Personal Blog Website">
    <link rel="icon" href="/images/photo.jpg">
  <link rel="manifest" href="/images/photo.jpg">
  <link rel="apple-touch-icon" href="/images/photo.jpg">
  <meta http-quiv="pragma" cotent="no-cache">
  <meta http-quiv="pragma" cotent="no-cache,must-revalidate">
  <meta http-quiv="expires" cotent="0">
    
    <link rel="preload" href="/assets/css/0.styles.0dbae9ec.css" as="style"><link rel="preload" href="/assets/js/app.c70e21ad.js" as="script"><link rel="preload" href="/assets/js/107.248733c2.js" as="script"><link rel="prefetch" href="/assets/js/10.15222a53.js"><link rel="prefetch" href="/assets/js/100.7e0e5a86.js"><link rel="prefetch" href="/assets/js/101.efd59f25.js"><link rel="prefetch" href="/assets/js/102.dfbdc06c.js"><link rel="prefetch" href="/assets/js/103.d3ab2109.js"><link rel="prefetch" href="/assets/js/104.117957ef.js"><link rel="prefetch" href="/assets/js/105.046e8ff3.js"><link rel="prefetch" href="/assets/js/106.aebdc17d.js"><link rel="prefetch" href="/assets/js/108.a2fecadc.js"><link rel="prefetch" href="/assets/js/109.35196857.js"><link rel="prefetch" href="/assets/js/11.770642f2.js"><link rel="prefetch" href="/assets/js/110.cf3d973c.js"><link rel="prefetch" href="/assets/js/111.f985889a.js"><link rel="prefetch" href="/assets/js/112.ad614f41.js"><link rel="prefetch" href="/assets/js/113.f666653c.js"><link rel="prefetch" href="/assets/js/114.c6c3f384.js"><link rel="prefetch" href="/assets/js/115.e51d3c2f.js"><link rel="prefetch" href="/assets/js/116.4f4b39f5.js"><link rel="prefetch" href="/assets/js/117.99352e11.js"><link rel="prefetch" href="/assets/js/118.c6ae6572.js"><link rel="prefetch" href="/assets/js/119.4ccbe778.js"><link rel="prefetch" href="/assets/js/12.042a92ff.js"><link rel="prefetch" href="/assets/js/120.edda1c4f.js"><link rel="prefetch" href="/assets/js/121.30a638ed.js"><link rel="prefetch" href="/assets/js/122.6efcefb1.js"><link rel="prefetch" href="/assets/js/123.91e6665b.js"><link rel="prefetch" href="/assets/js/124.f27e3d7e.js"><link rel="prefetch" href="/assets/js/125.c75712d5.js"><link rel="prefetch" href="/assets/js/126.ed756cce.js"><link rel="prefetch" href="/assets/js/127.2f06c74c.js"><link rel="prefetch" href="/assets/js/128.d5f6f30e.js"><link rel="prefetch" href="/assets/js/129.508b7eed.js"><link rel="prefetch" href="/assets/js/13.b5280c37.js"><link rel="prefetch" href="/assets/js/130.dc05f9aa.js"><link rel="prefetch" href="/assets/js/131.e0ba69b1.js"><link rel="prefetch" href="/assets/js/132.d79bcaa4.js"><link rel="prefetch" href="/assets/js/133.34acc01a.js"><link rel="prefetch" href="/assets/js/134.dabf64d5.js"><link rel="prefetch" href="/assets/js/135.ad90c915.js"><link rel="prefetch" href="/assets/js/136.dbb0074f.js"><link rel="prefetch" href="/assets/js/137.284ad365.js"><link rel="prefetch" href="/assets/js/138.a4b6856f.js"><link rel="prefetch" href="/assets/js/139.c9c1e20f.js"><link rel="prefetch" href="/assets/js/14.df02ba38.js"><link rel="prefetch" href="/assets/js/140.8b0a9269.js"><link rel="prefetch" href="/assets/js/141.9c7759c5.js"><link rel="prefetch" href="/assets/js/142.a4201a82.js"><link rel="prefetch" href="/assets/js/143.d7da6e8c.js"><link rel="prefetch" href="/assets/js/144.5e48e65d.js"><link rel="prefetch" href="/assets/js/145.a0e2633c.js"><link rel="prefetch" href="/assets/js/146.3c775f9b.js"><link rel="prefetch" href="/assets/js/147.22add89a.js"><link rel="prefetch" href="/assets/js/148.cfde1009.js"><link rel="prefetch" href="/assets/js/149.ffc835b5.js"><link rel="prefetch" href="/assets/js/15.fbdfc4ee.js"><link rel="prefetch" href="/assets/js/150.406c4b20.js"><link rel="prefetch" href="/assets/js/151.b2040eea.js"><link rel="prefetch" href="/assets/js/152.7bc65661.js"><link rel="prefetch" href="/assets/js/153.1d7c65e3.js"><link rel="prefetch" href="/assets/js/154.1309de49.js"><link rel="prefetch" href="/assets/js/155.81d3ee1f.js"><link rel="prefetch" href="/assets/js/156.154a4ef2.js"><link rel="prefetch" href="/assets/js/16.e5eb6147.js"><link rel="prefetch" href="/assets/js/17.57853c4a.js"><link rel="prefetch" href="/assets/js/18.cb9d7518.js"><link rel="prefetch" href="/assets/js/19.f354dc47.js"><link rel="prefetch" href="/assets/js/2.570d8a23.js"><link rel="prefetch" href="/assets/js/20.b5af7fad.js"><link rel="prefetch" href="/assets/js/21.0b1928fe.js"><link rel="prefetch" href="/assets/js/22.f78666de.js"><link rel="prefetch" href="/assets/js/23.29c3f366.js"><link rel="prefetch" href="/assets/js/24.6f596516.js"><link rel="prefetch" href="/assets/js/25.14067b60.js"><link rel="prefetch" href="/assets/js/26.74ba4989.js"><link rel="prefetch" href="/assets/js/27.13d60edd.js"><link rel="prefetch" href="/assets/js/28.9523cb32.js"><link rel="prefetch" href="/assets/js/29.8ec842e9.js"><link rel="prefetch" href="/assets/js/3.3fb3d2e0.js"><link rel="prefetch" href="/assets/js/30.805597a8.js"><link rel="prefetch" href="/assets/js/31.831b195d.js"><link rel="prefetch" href="/assets/js/32.063c672d.js"><link rel="prefetch" href="/assets/js/33.6d93fac3.js"><link rel="prefetch" href="/assets/js/34.56e8263c.js"><link rel="prefetch" href="/assets/js/35.dbe688bb.js"><link rel="prefetch" href="/assets/js/36.dc5af2c1.js"><link rel="prefetch" href="/assets/js/37.0a7494f6.js"><link rel="prefetch" href="/assets/js/38.fe4fc171.js"><link rel="prefetch" href="/assets/js/39.f5ed5e92.js"><link rel="prefetch" href="/assets/js/4.2c405ec8.js"><link rel="prefetch" href="/assets/js/40.fe7e2714.js"><link rel="prefetch" href="/assets/js/41.30b0811d.js"><link rel="prefetch" href="/assets/js/42.76f52d62.js"><link rel="prefetch" href="/assets/js/43.e7bb0817.js"><link rel="prefetch" href="/assets/js/44.ead0e883.js"><link rel="prefetch" href="/assets/js/45.235df046.js"><link rel="prefetch" href="/assets/js/46.5f09e829.js"><link rel="prefetch" href="/assets/js/47.67116354.js"><link rel="prefetch" href="/assets/js/48.31f34543.js"><link rel="prefetch" href="/assets/js/49.10b5ebba.js"><link rel="prefetch" href="/assets/js/5.6f47322c.js"><link rel="prefetch" href="/assets/js/50.c0f0b7f1.js"><link rel="prefetch" href="/assets/js/51.5143f3bf.js"><link rel="prefetch" href="/assets/js/52.eeddfd48.js"><link rel="prefetch" href="/assets/js/53.eb790db5.js"><link rel="prefetch" href="/assets/js/54.8fe5421c.js"><link rel="prefetch" href="/assets/js/55.d8f9004b.js"><link rel="prefetch" href="/assets/js/56.62ac9b92.js"><link rel="prefetch" href="/assets/js/57.a9caec0d.js"><link rel="prefetch" href="/assets/js/58.f93fc522.js"><link rel="prefetch" href="/assets/js/59.a81a03aa.js"><link rel="prefetch" href="/assets/js/6.8c2ea393.js"><link rel="prefetch" href="/assets/js/60.ab782775.js"><link rel="prefetch" href="/assets/js/61.6dd12daf.js"><link rel="prefetch" href="/assets/js/62.76f4b01f.js"><link rel="prefetch" href="/assets/js/63.6f8a4742.js"><link rel="prefetch" href="/assets/js/64.6f8bb1fa.js"><link rel="prefetch" href="/assets/js/65.4120a44b.js"><link rel="prefetch" href="/assets/js/66.360c2d2b.js"><link rel="prefetch" href="/assets/js/67.26f84d32.js"><link rel="prefetch" href="/assets/js/68.68f45e5e.js"><link rel="prefetch" href="/assets/js/69.e311eb56.js"><link rel="prefetch" href="/assets/js/7.6762b2d7.js"><link rel="prefetch" href="/assets/js/70.cea82674.js"><link rel="prefetch" href="/assets/js/71.783ddcf7.js"><link rel="prefetch" href="/assets/js/72.e5467385.js"><link rel="prefetch" href="/assets/js/73.b8fb681b.js"><link rel="prefetch" href="/assets/js/74.1bae37db.js"><link rel="prefetch" href="/assets/js/75.024387e5.js"><link rel="prefetch" href="/assets/js/76.a8e53010.js"><link rel="prefetch" href="/assets/js/77.8c55500a.js"><link rel="prefetch" href="/assets/js/78.7ce90bf5.js"><link rel="prefetch" href="/assets/js/79.ef71713f.js"><link rel="prefetch" href="/assets/js/8.788a6364.js"><link rel="prefetch" href="/assets/js/80.acad589d.js"><link rel="prefetch" href="/assets/js/81.02670d10.js"><link rel="prefetch" href="/assets/js/82.53b7b1ac.js"><link rel="prefetch" href="/assets/js/83.99eb8581.js"><link rel="prefetch" href="/assets/js/84.d1535ce3.js"><link rel="prefetch" href="/assets/js/85.fe2b7de9.js"><link rel="prefetch" href="/assets/js/86.41850272.js"><link rel="prefetch" href="/assets/js/87.1cdc6df9.js"><link rel="prefetch" href="/assets/js/88.01bf3461.js"><link rel="prefetch" href="/assets/js/89.17c69819.js"><link rel="prefetch" href="/assets/js/9.3813842d.js"><link rel="prefetch" href="/assets/js/90.f6ae7e35.js"><link rel="prefetch" href="/assets/js/91.507bc284.js"><link rel="prefetch" href="/assets/js/92.90551782.js"><link rel="prefetch" href="/assets/js/93.dc442d78.js"><link rel="prefetch" href="/assets/js/94.315f4e94.js"><link rel="prefetch" href="/assets/js/95.ccd6c6bf.js"><link rel="prefetch" href="/assets/js/96.0c6d89d0.js"><link rel="prefetch" href="/assets/js/97.1a9f10a9.js"><link rel="prefetch" href="/assets/js/98.43be3caa.js"><link rel="prefetch" href="/assets/js/99.54c8207b.js">
    <link rel="stylesheet" href="/assets/css/0.styles.0dbae9ec.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><!----> <span class="site-name">whoway</span></a> <div class="links" style="max-width:nullpx;"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">🎓Coding</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/00.Coding/TheBeautyOfProgramming/" class="nav-link">🔖编程之美题解</a></li><li class="dropdown-item"><!----> <a href="/00.Coding/CodeWarehouse/" class="nav-link">🔖代码意识流</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">🚀语言</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/01.Language/Overview/" class="nav-link">🔖概述</a></li><li class="dropdown-item"><!----> <a href="/01.Language/C/" class="nav-link">⭐️C</a></li><li class="dropdown-item"><!----> <a href="/01.Language/Cpp/" class="nav-link">🚀C++</a></li><li class="dropdown-item"><!----> <a href="/01.Language/Java/" class="nav-link">☕️Java</a></li><li class="dropdown-item"><!----> <a href="/01.Language/Python/" class="nav-link">🧩Python3</a></li></ul></div></div><div class="nav-item"><a href="/02.Hardware/" class="nav-link">✔️硬件基础</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">⭐️软件基础</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/03.Software/01.DataStructureAndAlgorithm/" class="nav-link">🐾数据结构和算法</a></li><li class="dropdown-item"><!----> <a href="/03.Software/02.OS/" class="nav-link">💻操作系统</a></li><li class="dropdown-item"><!----> <a href="/03.Software/03.Net/" class="nav-link">☁️计算机网络</a></li><li class="dropdown-item"><!----> <a href="/03.Software/04.SE/" class="nav-link">✅软件工程</a></li></ul></div></div><div class="nav-item"><a href="/04.Database/" class="nav-link">🎨数据库</a></div><div class="nav-item"><a href="/05.Engineer/" class="nav-link router-link-active">🔖学术/工程</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">⚙️工具</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/06.Tools/01.employment/" class="nav-link">🔖求职</a></li><li class="dropdown-item"><!----> <a href="/06.Tools/02.efficiency/" class="nav-link">🚀效能</a></li><li class="dropdown-item"><!----> <a href="/06.Tools/03.windows/" class="nav-link">⚙️Windows</a></li><li class="dropdown-item"><!----> <a href="/06.Tools/04.design/" class="nav-link">🧩设计</a></li><li class="dropdown-item"><!----> <a href="/06.Tools/05.linux/" class="nav-link">🐉Linux</a></li></ul></div></div><div class="nav-item"><a href="https://github.com/whoway" target="_blank" rel="noopener noreferrer" class="nav-link external">
  GitHub
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <div class="sidebar"><nav class="nav-links"><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">🎓Coding</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/00.Coding/TheBeautyOfProgramming/" class="nav-link">🔖编程之美题解</a></li><li class="dropdown-item"><!----> <a href="/00.Coding/CodeWarehouse/" class="nav-link">🔖代码意识流</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">🚀语言</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/01.Language/Overview/" class="nav-link">🔖概述</a></li><li class="dropdown-item"><!----> <a href="/01.Language/C/" class="nav-link">⭐️C</a></li><li class="dropdown-item"><!----> <a href="/01.Language/Cpp/" class="nav-link">🚀C++</a></li><li class="dropdown-item"><!----> <a href="/01.Language/Java/" class="nav-link">☕️Java</a></li><li class="dropdown-item"><!----> <a href="/01.Language/Python/" class="nav-link">🧩Python3</a></li></ul></div></div><div class="nav-item"><a href="/02.Hardware/" class="nav-link">✔️硬件基础</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">⭐️软件基础</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/03.Software/01.DataStructureAndAlgorithm/" class="nav-link">🐾数据结构和算法</a></li><li class="dropdown-item"><!----> <a href="/03.Software/02.OS/" class="nav-link">💻操作系统</a></li><li class="dropdown-item"><!----> <a href="/03.Software/03.Net/" class="nav-link">☁️计算机网络</a></li><li class="dropdown-item"><!----> <a href="/03.Software/04.SE/" class="nav-link">✅软件工程</a></li></ul></div></div><div class="nav-item"><a href="/04.Database/" class="nav-link">🎨数据库</a></div><div class="nav-item"><a href="/05.Engineer/" class="nav-link router-link-active">🔖学术/工程</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">⚙️工具</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/06.Tools/01.employment/" class="nav-link">🔖求职</a></li><li class="dropdown-item"><!----> <a href="/06.Tools/02.efficiency/" class="nav-link">🚀效能</a></li><li class="dropdown-item"><!----> <a href="/06.Tools/03.windows/" class="nav-link">⚙️Windows</a></li><li class="dropdown-item"><!----> <a href="/06.Tools/04.design/" class="nav-link">🧩设计</a></li><li class="dropdown-item"><!----> <a href="/06.Tools/05.linux/" class="nav-link">🐉Linux</a></li></ul></div></div><div class="nav-item"><a href="https://github.com/whoway" target="_blank" rel="noopener noreferrer" class="nav-link external">
  GitHub
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <!----></nav>  <ul class="sidebar-links"><li><div class="sidebar-group first"><p class="sidebar-heading open"><span>编译原理笔记</span> <!----></p> <ul class="sidebar-group-items"><li><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#目录" class="sidebar-link">目录</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#第1讲-引论" class="sidebar-link">第1讲 引论</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#_1-1-什么是编译程序" class="sidebar-link">1.1 什么是编译程序</a></li><li class="sidebar-sub-header"><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#_1-2-为什么要学习编译原理" class="sidebar-link">1.2 为什么要学习编译原理</a></li><li class="sidebar-sub-header"><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#_1-3-编译过程" class="sidebar-link">1.3 编译过程</a></li><li class="sidebar-sub-header"><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#_1-4-编译程序的结构" class="sidebar-link">1.4 编译程序的结构</a></li><li class="sidebar-sub-header"><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#_1-5-编译程序的生成" class="sidebar-link">1.5 编译程序的生成</a></li><li class="sidebar-sub-header"><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#_1-6-小结" class="sidebar-link">1.6 小结</a></li></ul></li><li><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#第2讲-高级程序设计语言概述" class="sidebar-link">第2讲 高级程序设计语言概述</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#_2-1-常用的高级程序设计语言" class="sidebar-link">2.1 常用的高级程序设计语言</a></li><li class="sidebar-sub-header"><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#_2-2-程序设计语言的定义" class="sidebar-link">2.2 程序设计语言的定义</a></li><li class="sidebar-sub-header"><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#_2-3-高级程序设计语言的一般特性" class="sidebar-link">2.3 高级程序设计语言的一般特性</a></li><li class="sidebar-sub-header"><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#_2-4-小结" class="sidebar-link">2.4 小结</a></li></ul></li><li><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#第3讲-高级程序设计语言的语法描述" class="sidebar-link">第3讲 高级程序设计语言的语法描述</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#第4讲-词法分析1" class="sidebar-link">第4讲 词法分析1</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#第5讲-词法分析2" class="sidebar-link">第5讲 词法分析2</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#第6讲-词法分析3" class="sidebar-link">第6讲 词法分析3</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#第7讲-语法分析——自上而下分析1" class="sidebar-link">第7讲 语法分析——自上而下分析1</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#第8讲-语法分析——自上而下分析2" class="sidebar-link">第8讲  语法分析——自上而下分析2</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#第9讲-语法分析——自上而下分析3" class="sidebar-link">第9讲  语法分析——自上而下分析3</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#第10讲-语法分析——自下而上分析1" class="sidebar-link">第10讲  语法分析——自下而上分析1</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#第11讲-语法分析——自下而上分析2" class="sidebar-link">第11讲 语法分析——自下而上分析2</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#第12讲-语法分析——自下而上分析3" class="sidebar-link">第12讲 语法分析——自下而上分析3</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#第13讲-语法分析——自下而上分析4" class="sidebar-link">第13讲 语法分析——自下而上分析4</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#✅第14讲-属性文法和语法制导翻译1" class="sidebar-link">✅第14讲 属性文法和语法制导翻译1</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#第15讲-属性文法和语法制导翻译2" class="sidebar-link">第15讲 属性文法和语法制导翻译2</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#第16讲-语义分析和中间代码生成1" class="sidebar-link">第16讲 语义分析和中间代码生成1</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#第17讲-语义分析和中间代码生成2" class="sidebar-link">第17讲 语义分析和中间代码生成2</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#第18讲-语义分析和中间代码生成3" class="sidebar-link">第18讲 语义分析和中间代码生成3</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#第19讲-语义分析和中间代码生成4" class="sidebar-link">第19讲 语义分析和中间代码生成4</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#第20讲-符号表" class="sidebar-link">第20讲 符号表</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#第21讲-运行时存储空间组织1" class="sidebar-link">第21讲 运行时存储空间组织1</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#第22讲-运行时存储空间组织2" class="sidebar-link">第22讲 运行时存储空间组织2</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#第23讲-优化1" class="sidebar-link">第23讲 优化1</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#第24讲-优化2" class="sidebar-link">第24讲 优化2</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/05.Engineer/compilation/%E2%80%94%E2%80%94%E2%80%94%E2%80%94%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E5%9B%BD%E9%98%B2%E7%A7%91%E5%A4%A7%E7%AC%94%E8%AE%B0.html#第25讲-目标代码生成" class="sidebar-link">第25讲 目标代码生成</a><ul class="sidebar-sub-headers"></ul></li></ul></div></li></ul> </div> <div class="page"> <div class="content"><h1 id="编译原理笔记"><a href="#编译原理笔记" class="header-anchor">#</a> 编译原理笔记</h1> <ul><li>中国大学MOOC，<a href="https://www.icourse163.org/course/NUDT-1003101005?from=searchPage" target="_blank" rel="noopener noreferrer">编译原理<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li> <li>哔哩哔哩，编译原理-<a href="https://www.bilibili.com/video/BV12741147J3?from=search&seid=14680691575079128415&spm_id_from=333.337.0.0" target="_blank" rel="noopener noreferrer">国防科技大学<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a>「抢先观看」</li></ul> <h2 id="目录"><a href="#目录" class="header-anchor">#</a> 目录</h2> <blockquote><p>课程内容：介绍程序设计语言编译程序构造的基本原理和 基本实现技术</p></blockquote> <p>[TOC]</p> <h2 id="第1讲-引论"><a href="#第1讲-引论" class="header-anchor">#</a> 第1讲 引论</h2> <h3 id="_1-1-什么是编译程序"><a href="#_1-1-什么是编译程序" class="header-anchor">#</a> 1.1 什么是编译程序</h3> <ul><li>翻译程序(Translator)：把某一种语言程序(称为<strong>源语言程序</strong>)等价地转换 成另一种语言程序(称为<strong>目标语言程序</strong>)的程序</li> <li>编译程序(Compiler)：把某一种<strong>高级语言程序</strong>等价地转换成另一种 <strong>低级语言程序</strong>(如汇编语言或机器语言程序)的程序
<ul><li>诊断编译程序(Diagnostic Compiler)</li> <li>优化编译程序(Optimizing Compiler)</li> <li>交叉编译程序(Cross Compiler)</li> <li>可变目标编译程序(Retargetable Compiler)</li></ul></li> <li>解释程序(Interpreter)：把源语言写的源程序作为输入，但<strong>不产生目标 程序</strong>，而是<strong>边解释边执行</strong>源程序</li></ul> <h3 id="_1-2-为什么要学习编译原理"><a href="#_1-2-为什么要学习编译原理" class="header-anchor">#</a> 1.2 为什么要学习编译原理</h3> <ul><li>理解计算系统</li> <li>设计计算系统</li> <li>训练计算思维(Computational Thinking)
<ul><li>方法论的提取：Jeannette M. Wing, <a href="https://www.cs.cmu.edu/~15110-s13/Wing06-ct.pdf" target="_blank" rel="noopener noreferrer">Computational Thinking<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a>, Communications of ACM, Vol.49, No.3, 2006, pp.33-35.</li></ul></li></ul> <div class="language-txt line-numbers-mode"><pre class="language-text"><code>包括一系列广泛的计算机科学的思维方法
 抽象(Abstraction)
 自动化
 问题分解
 递归
 权衡
 保护、冗余、容错、纠错和恢复
 利用启发式推理来寻求解答
 在不确定情况下的规划、学习和调度
 ...
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br></div></div><p>编译理论与技术</p> <ul><li>计算机科学与技术中<strong>理论</strong>和<strong>实践</strong>相结合的最好典范</li> <li>ACM图灵奖数据<a href="https://amturing.acm.org/bysubject.cfm" target="_blank" rel="noopener noreferrer">网站<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h4 id="图灵机"><a href="#图灵机" class="header-anchor">#</a> 图灵机</h4> <ul><li> 抽象(Abstraction)</li></ul> <div class="language-txt line-numbers-mode"><pre class="language-text"><code> 一条无限长的纸带
 一个读写头
 一个状态寄存器
 一套控制读写头工作的规则

图灵机
 邱奇-图灵论题(The Church-Turing thesis)
 所有计算或算法都可以由一台图灵机来执行
 可计算=图灵可计算
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br></div></div><h3 id="_1-3-编译过程"><a href="#_1-3-编译过程" class="header-anchor">#</a> 1.3 编译过程</h3> <h3 id="_1-4-编译程序的结构"><a href="#_1-4-编译程序的结构" class="header-anchor">#</a> 1.4 编译程序的结构</h3> <h3 id="_1-5-编译程序的生成"><a href="#_1-5-编译程序的生成" class="header-anchor">#</a> 1.5 编译程序的生成</h3> <h3 id="_1-6-小结"><a href="#_1-6-小结" class="header-anchor">#</a> 1.6 小结</h3> <p><img src="https://cdn.jsdelivr.net/gh/HACV/picture/img/20210910103401.png" alt="image-20210910103401045"></p> <ul><li>遍(pass)</li> <li> 所谓&quot;遍&quot;， 就是对源程序或源程序的中间表示 从头到尾扫描一次</li> <li> 阶段与遍是不同的概念
<ul><li> 一遍可以由若干段组成</li> <li> 一个阶段也可以分若干遍来完成</li></ul></li></ul> <p><img src="https://cdn.jsdelivr.net/gh/HACV/picture/img/20210910103536.png" alt="image-20210910103536862"></p> <h2 id="第2讲-高级程序设计语言概述"><a href="#第2讲-高级程序设计语言概述" class="header-anchor">#</a> 第2讲 高级程序设计语言概述</h2> <h3 id="_2-1-常用的高级程序设计语言"><a href="#_2-1-常用的高级程序设计语言" class="header-anchor">#</a> 2.1 常用的高级程序设计语言</h3> <p>程序本质上是一定字符集上的字符串</p> <ul><li><strong>语法</strong>：一组规则，用它可以形成和产生一个合式(well-formed)的程序</li></ul> <h4 id="词法规则：单词符号的形成规则"><a href="#词法规则：单词符号的形成规则" class="header-anchor">#</a> 词法规则：单词符号的形成规则</h4> <ul><li> 单词符号是语言中具有独立意义的最基本结构</li> <li> 一般包括：常数、标识符、基本字、算符、界符等</li> <li> 描述工具：<strong>有限自动机</strong></li></ul> <h4 id="语法规则：语法单位的形成规则"><a href="#语法规则：语法单位的形成规则" class="header-anchor">#</a> 语法规则：语法单位的形成规则</h4> <ul><li>语法单位通常包括：表达式、语句、分程序、过程、 函数、程序等;</li> <li> 描述工具：上下文无关文法</li></ul> <h3 id="_2-2-程序设计语言的定义"><a href="#_2-2-程序设计语言的定义" class="header-anchor">#</a> 2.2 程序设计语言的定义</h3> <h3 id="_2-3-高级程序设计语言的一般特性"><a href="#_2-3-高级程序设计语言的一般特性" class="header-anchor">#</a> 2.3 高级程序设计语言的一般特性</h3> <h3 id="_2-4-小结"><a href="#_2-4-小结" class="header-anchor">#</a> 2.4 小结</h3> <h2 id="第3讲-高级程序设计语言的语法描述"><a href="#第3讲-高级程序设计语言的语法描述" class="header-anchor">#</a> 第3讲 高级程序设计语言的语法描述</h2> <p>3.1 上下文无关文法</p> <p>3.2 文法与语言</p> <p>3.3 语法树与二义性</p> <p>3.4 形式语言鸟瞰</p> <p>3.5 小结</p> <h2 id="第4讲-词法分析1"><a href="#第4讲-词法分析1" class="header-anchor">#</a> 第4讲 词法分析1</h2> <p>4.1 词法分析概述</p> <p>4.2 词法分析器的设计</p> <p>4.3 小结</p> <h2 id="第5讲-词法分析2"><a href="#第5讲-词法分析2" class="header-anchor">#</a> 第5讲 词法分析2</h2> <p>5.1 词法规则形式化——正规集与正规式</p> <p>5.2 确定有限自动机</p> <p>5.3 非确定有限自动机</p> <p>5.4 小结</p> <h2 id="第6讲-词法分析3"><a href="#第6讲-词法分析3" class="header-anchor">#</a> 第6讲 词法分析3</h2> <p>6.1 有限自动机的等价性</p> <p>6.2 正规式与有限自动机的等价性</p> <p>6.3 词法分析程序自动生成</p> <p>第1次单元测试</p> <h2 id="第7讲-语法分析——自上而下分析1"><a href="#第7讲-语法分析——自上而下分析1" class="header-anchor">#</a> 第7讲 语法分析——自上而下分析1</h2> <p>7.1 自上而下分析的基本问题</p> <p>7.2 LL(1)文法——消除文法的左递归</p> <p>7.3 LL(1)文法——消除回溯</p> <p>7.4  FIRST和FOLLOW集合的构造</p> <p>7.5 小结</p> <h2 id="第8讲-语法分析——自上而下分析2"><a href="#第8讲-语法分析——自上而下分析2" class="header-anchor">#</a> 第8讲  语法分析——自上而下分析2</h2> <p>8.1 构造递归下降分析器</p> <p>8.2 扩充的巴科斯范式和语法图</p> <p>8.3 JavaCC简介</p> <p>8.4 小结</p> <h2 id="第9讲-语法分析——自上而下分析3"><a href="#第9讲-语法分析——自上而下分析3" class="header-anchor">#</a> 第9讲  语法分析——自上而下分析3</h2> <p>9.1 预测分析程序</p> <p>9.2 预测分析表的构造</p> <p>9.3 小结</p> <h2 id="第10讲-语法分析——自下而上分析1"><a href="#第10讲-语法分析——自下而上分析1" class="header-anchor">#</a> 第10讲  语法分析——自下而上分析1</h2> <p>10.3 分析过程描述</p> <p>10.4 算符优先文法</p> <p>10.5 构造优先关系表</p> <p>10.6 算符优先分析算法</p> <p>10.7 小结</p> <p>10.1 自下而上分析</p> <p>10.2 短语与直接短语</p> <h2 id="第11讲-语法分析——自下而上分析2"><a href="#第11讲-语法分析——自下而上分析2" class="header-anchor">#</a> 第11讲 语法分析——自下而上分析2</h2> <p>11.1 句柄和规范归约</p> <p>11.2 LR分析法</p> <p>11.3 小结</p> <h2 id="第12讲-语法分析——自下而上分析3"><a href="#第12讲-语法分析——自下而上分析3" class="header-anchor">#</a> 第12讲 语法分析——自下而上分析3</h2> <p>12.1 活前缀</p> <p>12.2 构造识别活前缀的DFA</p> <p>12.3 构造LR(0)分析表</p> <p>12.4 小结</p> <h2 id="第13讲-语法分析——自下而上分析4"><a href="#第13讲-语法分析——自下而上分析4" class="header-anchor">#</a> 第13讲 语法分析——自下而上分析4</h2> <p>13.1 SLR(1)分析法</p> <p>13.2 LR(1)分析法</p> <p>13.3 LR分析器产生工具</p> <p>13.4 小结</p> <p>第2次单元测试</p> <h2 id="✅第14讲-属性文法和语法制导翻译1"><a href="#✅第14讲-属性文法和语法制导翻译1" class="header-anchor">#</a> ✅第14讲 属性文法和语法制导翻译1</h2> <p>14.1 属性文法</p> <p>14.2 属性计算</p> <h2 id="第15讲-属性文法和语法制导翻译2"><a href="#第15讲-属性文法和语法制导翻译2" class="header-anchor">#</a> 第15讲 属性文法和语法制导翻译2</h2> <p>15.1 S-属性文法</p> <p>15.2 L-属性文法</p> <p>15.3 翻译模式</p> <p>15.4 递归下降翻译器的设计</p> <p>15.5 小结</p> <h2 id="第16讲-语义分析和中间代码生成1"><a href="#第16讲-语义分析和中间代码生成1" class="header-anchor">#</a> 第16讲 语义分析和中间代码生成1</h2> <p>16.1 中间语言</p> <p>16.2 常用的中间语言形式</p> <p>16.3 小结</p> <p>第3次单元测试</p> <h2 id="第17讲-语义分析和中间代码生成2"><a href="#第17讲-语义分析和中间代码生成2" class="header-anchor">#</a> 第17讲 语义分析和中间代码生成2</h2> <p>17.1 赋值语句的翻译</p> <p>17.2 数组元素引用的翻译</p> <p>17.3 类型转换</p> <p>17.4 小结</p> <h2 id="第18讲-语义分析和中间代码生成3"><a href="#第18讲-语义分析和中间代码生成3" class="header-anchor">#</a> 第18讲 语义分析和中间代码生成3</h2> <p>18.1 布尔表达式及其计算</p> <p>18.2 按数值表示法翻译布尔表达式</p> <p>18.3 带优化翻译布尔表达式</p> <p>18.4 小结</p> <h2 id="第19讲-语义分析和中间代码生成4"><a href="#第19讲-语义分析和中间代码生成4" class="header-anchor">#</a> 第19讲 语义分析和中间代码生成4</h2> <p>19.1 常用的控制语句</p> <p>19.2 控制语句的属性文法</p> <p>19.3 控制语句的属性计算</p> <p>19.4 一遍扫描翻译控制语句</p> <p>19.5 一遍扫描翻译控制语句示例</p> <p>19.6 小结</p> <p>第4次单元测试</p> <h2 id="第20讲-符号表"><a href="#第20讲-符号表" class="header-anchor">#</a> 第20讲 符号表</h2> <p>20.1 符号表的组织与操作</p> <p>20.2 符号表的内容</p> <p>20.3 利用符号表分析名字的作用域</p> <p>20.4 小结</p> <h2 id="第21讲-运行时存储空间组织1"><a href="#第21讲-运行时存储空间组织1" class="header-anchor">#</a> 第21讲 运行时存储空间组织1</h2> <p>21.1 参数传递</p> <p>21.2 目标程序运行时的活动</p> <p>21.3 静态存储管理</p> <h2 id="第22讲-运行时存储空间组织2"><a href="#第22讲-运行时存储空间组织2" class="header-anchor">#</a> 第22讲 运行时存储空间组织2</h2> <p>22.1 动态存储管理概述</p> <p>22.2 非嵌套过程语言的动态存储管理</p> <p>22.3 嵌套过程语言的动态存储管理--静态链方法</p> <p>22.4 嵌套过程语言的动态存储管理--Display表方法</p> <p>22.5 小结</p> <h2 id="第23讲-优化1"><a href="#第23讲-优化1" class="header-anchor">#</a> 第23讲 优化1</h2> <p>23.1 优化概述</p> <p>23.2 局部优化--基本块划分</p> <p>23.3 局部优化--基本块优化</p> <h2 id="第24讲-优化2"><a href="#第24讲-优化2" class="header-anchor">#</a> 第24讲 优化2</h2> <p>24.1 循环优化概述</p> <p>24.2 代码外提</p> <p>24.3 强度消弱</p> <p>24.4 小结</p> <h2 id="第25讲-目标代码生成"><a href="#第25讲-目标代码生成" class="header-anchor">#</a> 第25讲 目标代码生成</h2> <p>25.1 目标代码生成概述</p> <p>25.2 目标机器模型</p> <p>25.3 简单代码生成器</p> <p>25.4 待用信息和活跃信息</p> <p>25.5 变量地址描述和寄存器描述</p> <p>25.6 代码生成与寄存器分配算法</p> <p>25.7 小结</p></div> <div class="page-edit"><!----> <!----></div> <!----> </div> <!----></div></div>
    <script src="/assets/js/app.c70e21ad.js" defer></script><script src="/assets/js/107.248733c2.js" defer></script>
  </body>
</html>
